<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鼠标点击位置</title>
    <style>
        html,body {
            width: 100%;
            height: 100%;
        }
    </style>
    <script>
        function dian(e) {
            dianX = e.clientX;
            dianY = e.clientY;
            alert("x:"+dianX+",y:"+dianY)
        }
    </script>
</head>
<body onclick="dian(event)">
    
</body>
</html>